#!/usr/bin/env node

const url = require('url'),
      qs = require('querystring'),
      log = console.log,
      http = require('http');
http.createServer((req,res)=>{
  log(req.url);
  //get pathname and query string
  let addr = url.parse(req.url);
  log(addr.pathname);
  log(addr.query);
  log(addr.pathname.split('/'));
  log(qs.parse(addr.query));
  res.end('end');
}).listen(8080);

